#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main() {
    int n = 0;
    while (scanf("%d", &n) != EOF)
    {
        int j = 0;
        for (j = 0; j < 4; j++)
        {
            printf("%d", n % 10);
            n = n / 10;
        }
    }
    return 0;
}